package com.gentech.springbucks.controller;

import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.spring.annotation.ApolloConfig;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ApolloTestController {

    @ApolloConfig("application")
    private Config applicationConfig;

    @GetMapping("/getApolloConfig, method = RequestMethod.GET")
    public String getApollo(String key){

        String value = applicationConfig.getProperty(key, "");
        System.out.println("apolloConfig key="+value);
        return value;
    }

}
